﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Wizard.UI;
using System.IO;

namespace DVRMS_Renamer
{
    public partial class wizPage5 : Wizard.UI.InternalWizardPage
    {
        private frmMain mobjOwnerForm;

        public wizPage5(frmMain OwnerForm)
        {
            InitializeComponent();

            mobjOwnerForm = OwnerForm;

            chkDuplicates.Checked = Globals.compareFolders;
            txtPath.Text = Globals.selectedCompareFolder;
        }

        private void wizPage5_WizardPageSetActive(object sender, CancelEventArgs e)
        {
            SetWizardButtons(WizardButtons.Next);
        }

        private void cmdBrowse_Click(object sender, EventArgs e)
        {
            if (folderBrowse.ShowDialog() == DialogResult.OK)
            {
                txtPath.Text = folderBrowse.SelectedPath;
            }
        }

        private void wizPage5_WizardNext(object sender, Wizard.UI.WizardPageEventArgs e)
        {
            Globals.compareFolders = (chkDuplicates.Checked);
            Globals.selectedCompareFolder = txtPath.Text;

            if (!chkDuplicates.Checked) e.NewPage = "wizPage7";
        }

        private void chkDuplicates_CheckedChanged(object sender, EventArgs e)
        {
            txtPath.Enabled = (chkDuplicates.Checked);
            cmdBrowse.Enabled = (chkDuplicates.Checked);
        }
    }
}
